package com.djmw.mouse.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * 为提供树状结构表达的行业而设计的实体对象。
 * @author leo
 */
public class IndustryNode {

	private Long id;
	private String name;
	private int order;
	private List<IndustryNode> children;

	public IndustryNode(Industry industry) {
		this.id = industry.id;
		this.name = industry.getName();
		this.order = industry.getOrder();
	}

	public Long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public int getOrder() {
		return order;
	}

	public List<IndustryNode> getSubIndustries() {
		return children;
	}

	public void addSubIndustry(IndustryNode subIndustry) {
		if (children == null) {
			children = new ArrayList<IndustryNode>();
		}
		children.add(subIndustry);
	}
}
